set DATABASE_URL=sqlite:///d:/code/sheisright/policy.db
type nul > policy.db
del users.db
cargo install sqlx-cli --no-default-features --features sqlite
cargo sqlx migrate run
cargo sqlx prepare
cargo build --release
:: 创建应用目录
mkdir "sheisright-deb\usr\local\share\sheisright"

:: 复制可执行文件
copy "target\release\toyou.exe" "sheisright-deb\usr\local\share\sheisright\"

:: 复制资源文件
copy "policy.db" "sheisright-deb\usr\local\share\sheisright\"
:: copy "users.db" "sheisright-deb\usr\local\share\sheisright\"
xcopy "assets\" "sheisright-deb\usr\local\share\sheisright\assets\" /E /I
xcopy "templates\" "sheisright-deb\usr\local\share\sheisright\templates\" /E /I
xcopy "fonts\" "sheisright-deb\usr\local\share\sheisright\fonts\" /E /I
copy "rbac_with_pattern_model.conf" "sheisright-deb\usr\local\share\sheisright\"
copy "rbac_with_pattern_policy.csv" "sheisright-deb\usr\local\share\sheisright\"
#cargo run --release

